function out = myFFT2(in)

    if max(size(size(in))) == 3
        in = rgb2gray(in); % 假如是彩图先转换
    end

    F = fft2(in); %傅里叶变换
    Fs = fftshift(F); %将频谱图中零频率成分移动至频谱图中心
    S = log(abs(Fs) + 1); %取模并进行缩放
    out = im2uint8(S / max(max(S))); %转换到uint8

end
